import request from '@/utils/request'

// 查询商品列表
export function listRental(query) {
  return request({
    url: '/system/rental/list',
    method: 'get',
    params: query
  })
}

// 查询商品详细
export function getRental(id) {
  return request({
    url: '/system/rental/' + id,
    method: 'get'
  })
}

// 新增商品
export function addRental(data) {
  return request({
    url: '/system/rental',
    method: 'post',
    data: data
  })
}

// 修改商品
export function updateRental(data) {
  return request({
    url: '/system/rental',
    method: 'put',
    data: data
  })
}

// 删除商品
export function delRental(id) {
  return request({
    url: '/system/rental/' + id,
    method: 'delete'
  })
}
export function changePopStatus(id, pop) {
  const data = {
    id,
    pop
  }
  return request({
    url: '/system/rental',
    method: 'put',
    data: data
  })
}
export function changeProfRecStatus(id, profRec) {
  const data = {
    id,
    profRec
  }
  return request({
    url: '/system/rental',
    method: 'put',
    data: data
  })
}
// 设置商品活动折扣
export function setdiscount(data) {
  return request({
    url: '/system/rental/setdiscount',
    method: 'post',
    data:data
  })
}
// 设置商品活动特价
export function setspecial(data) {
  return request({
    url: '/system/rental/setspecial',
    method: 'post',
    data:data
  })
}
